<?php
namespace app\admin\controller;

use think\View;
use think\Db;
class User
{
    public function user_list()
    {   
    	$view      = new View();
        $user_list = Db::name('user')->field('id,mobile,now_number')->select();
        
        $view->assign('list',$user_list);

        return $view->fetch();
    }

    public function user_prize_list(){
    	$view         = new View();
        $prize_record = Db::name('prize_record')
                        ->alias('pr')
                        ->join('prize p', 'pr.pid = p.id','left')
                        ->join('user u' , 'pr.mobile = u.mobile','left')
                        ->field('p.name,u.mobile,pr.create_time,pr.id')
                        ->order('pr.create_time desc')
                        ->where('u.id',input('id'))
                        ->select();

        $view->assign('list',$prize_record);

        return $view->fetch();
    }
}
